package com.dtz.order.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RestController;

import com.dtz.entities.CommonResult;
import com.dtz.order.feign.FeignService;

import lombok.extern.slf4j.Slf4j;

/**
 * 
 * @author 陶志胜
 *
 */
@RestController
@Slf4j
public class OrderController {

	@Autowired
	private FeignService feignService;
	
	@GetMapping(value = "/consumer/payment/get/{id}")
	public CommonResult<String> getPaymentById(@PathVariable("id") Long id) {
		return feignService.getPaymentById(id);
	}
	
	@GetMapping(value = "/consumer/payment/feign/timeout")
	public CommonResult<String> getPaymentById() {
		return new CommonResult(200, feignService.paymentFeignTimeout());
	}
	
}
